package com.dao;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

@Repository
public class BaseDao {
	
	@Autowired
	protected JdbcTemplate jdbcTemplate;
	
	public int executeUpdate(String sql,Object[] params) {
		
		return jdbcTemplate.update(sql, params);
	}
	
	public List<Map<String, Object>> executeQuery(String sql,Object[] params) {
		
		return jdbcTemplate.queryForList(sql, params);
	}
	
	public Map<String, Object> executeQueryMap(String sql,Object[] params) {
		
		return jdbcTemplate.queryForMap(sql, params);
	}
}
